package com.cdn.log.config;

import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * 蔡定努
 * 2025/03/10 15:47
 */
@ConfigurationProperties("clog")
public class ClogExecutorProperties {

    /**
     * 核心线程数（默认线程数）
     */
    private   int corePoolSize = Runtime.getRuntime().availableProcessors()+1;
    /**
     * 最大线程数
     */
    private   int maxPoolSize = corePoolSize*2;
    /**
     * 允许线程空闲时间（单位：默认为秒）
     */
    private   int keepAliveTime = 60;
    /**
     *  缓冲队列大小
     */
    private   int queueCapacity = 2000;
    /**
     * 线程池名前缀
     */
    private   String threadNamePrefix = "clog-executor-";


    public int getCorePoolSize() {
        return corePoolSize;
    }

    public void setCorePoolSize(int corePoolSize) {
        this.corePoolSize = corePoolSize;
    }

    public int getKeepAliveTime() {
        return keepAliveTime;
    }

    public void setKeepAliveTime(int keepAliveTime) {
        this.keepAliveTime = keepAliveTime;
    }

    public int getMaxPoolSize() {
        return maxPoolSize;
    }

    public void setMaxPoolSize(int maxPoolSize) {
        this.maxPoolSize = maxPoolSize;
    }

    public int getQueueCapacity() {
        return queueCapacity;
    }

    public void setQueueCapacity(int queueCapacity) {
        this.queueCapacity = queueCapacity;
    }

    public String getThreadNamePrefix() {
        return threadNamePrefix;
    }

    public void setThreadNamePrefix(String threadNamePrefix) {
        this.threadNamePrefix = threadNamePrefix;
    }
}
